package com.weixin1.service;

import com.weixin1.bean.Employee;
import com.weixin1.dao.EmployeeDao;

import java.sql.SQLException;
import java.util.List;

public class EmployeeService {
    EmployeeDao dao=new EmployeeDao();
    public List<Employee> list() throws SQLException {
        return dao.list();
    }
    public Employee getById(Long id) throws SQLException {
        return dao.getById(id);
    }
    public boolean save(Employee employee) throws SQLException {
        return dao.save(employee)>0;
    }
    public boolean removeById(Long id) throws SQLException {
        return dao.removeById(id)>0;
    }
    public boolean update(Employee employee) throws SQLException {
        return dao.update(employee)>0;
    }
    //获取数据总长度
    public int gettotal() throws SQLException {
        return dao.gettotal();
    }
    //分页查询
    public List<Employee> selectByPage(int page,int limit) throws SQLException {
        return dao.selectByPage(page,limit);
    }
}
